/*
 * engine.h
 *
 *  Created on: Mar 30, 2012
 *      Author: The Almighty Eric
 */

#ifndef ENGINE_H
#define ENGINE_H
#include <string>
#include <vector>
#include "SDL.h"
#include "SDL_image.h"
#include "SDL_ttf.h"
#include "Timer.h"

#define FLIP_VERTICAL 1
#define FLIP_HORIZONTAL 2

#define EDITOR 1
#define MAPTEST 2

class engine
{
public:

	//Variables
	bool quit;
	int state;
	SDL_Event event;
	SDL_Surface *background;
	SDL_Surface *screen;
	Timer timer;

	engine();
	bool Init();
	int getState();
	void setState(int i);
	void apply_surface(int x, int y, SDL_Surface* source, SDL_Surface* destination, SDL_Rect* clip);
	SDL_Surface *load_image(std::string filename);
	void setColorKeyT(SDL_Surface *surface, Uint32 pixel);
	Uint32 getPixel(SDL_Surface *surface, int x, int y);
	void setPixel(SDL_Surface *surface, int x, int y, Uint32 pixel);
	bool CollisionCheck(SDL_Rect A, SDL_Rect B);
	bool CollisionCheckPP(std::vector<SDL_Rect> A, std::vector<SDL_Rect> B);
	bool CollisionCheckCirc();
	SDL_Surface *FlipImage(SDL_Surface *source, Uint32 flags);
	void printS(SDL_Surface *screen, float x, float y, std::string s);

};

#endif
